Skip to content

[ty] ty_ide: Hotfix for expression_scope_id panics#18455

Merged
sharkdp merged 2 commits intomainfrom
david/hotfix-playground-scoped_expression_id
Jun 4, 2025
Merged

[ty] ty_ide: Hotfix for expression_scope_id panics#18455
sharkdp merged 2 commits intomainfrom
david/hotfix-playground-scoped_expression_id

Conversation

@sharkdp
Copy link
Contributor

@sharkdp sharkdp commented Jun 4, 2025

Summary

Implement a hotfix for the playground/LSP crashes related to missing expression_scope_ids.

relates to: astral-sh/ty#572

Test Plan

@sharkdp sharkdp requested a review from carljm as a code owner June 4, 2025 08:28
@sharkdp sharkdp added the server Related to the LSP server label Jun 4, 2025
@sharkdp sharkdp added the ty Multi-file analysis & type inference label Jun 4, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2025

mypy_primer results

No ecosystem changes detected ✅

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty

@sharkdp sharkdp merged commit 11db567 into main Jun 4, 2025
35 checks passed
@sharkdp sharkdp deleted the david/hotfix-playground-scoped_expression_id branch June 4, 2025 08:39
ast::AnyNodeRef::Identifier(identifier) => index.expression_scope_id(identifier),

// TODO: We currently use `try_expression_scope_id` here as a hotfix for [1].
// Revert this to use `expression_scope_id` once a proper fix is in place.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Not a request to actually change this comment, but) I'm not convinced we should necessarily ever change this back to using expression_scope_id, regardless of what other fixes are made.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Admittedly, I didn't follow the full discussion in #18441, so I was potentially overly-cautious here. I opened this PR mainly because I can't work without the ty playground anymore 🙃.

carljm added a commit to mtshiba/ruff that referenced this pull request Jun 4, 2025
* main:
  [ty] Only consider a type `T` a subtype of a protocol `P` if all of `P`'s members are fully bound on `T` (astral-sh#18466)
  [ty] Exclude members starting with `_abc_` from a protocol interface (astral-sh#18467)
  [ty] Add subdiagnostic suggestion to `unresolved-reference` diagnostic when variable exists on `self` (astral-sh#18444)
  [ty] IDE: only provide declarations and bindings as completions (astral-sh#18456)
  [ty] ty_ide: Hotfix for `expression_scope_id` panics (astral-sh#18455)
  [ty] Improve docs for Class{Literal,Type}::instance_member (astral-sh#18454)
  [ty] Add meta-type tests for legavy TypeVars (astral-sh#18453)
  update to salsa that doesn't panic silently on cycles (astral-sh#18450)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

server Related to the LSP server ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants